#include <iostream>

using namespace std;

int findMax(const int *arr, const int &l, const int &r) {
    int m = (l + r) / 2;
    if (l == r - 1) return arr[l];
    else {
        int u = findMax(arr, l, m);
        int v = findMax(arr, m, r);
        return std::max(u, v);
    }
}

int main() {
    int arr[] = {1, 2, 9, 20 ,100, 39, 30, 10, 50};

    cout << findMax(arr, 0, 9) << endl;

    return 0;
}